import {deleteAction, getAction, postAction, downFile, getFileAccessHttpUrl} from '@/api/request'

export const application12 = {

    data() {
        return {
            url: {
                tab12Infor: "/api/ac/subsistence/ss12001Service/getSs12001Infor",
                tab12Submit: "/api/ac/subsistence/ss12001Service/updateTab12Submit",
                getMemberList: "/api/ac/subsistence/ss12001ChangeService/getMemberList"
            },
            memberList: [],
            Loading: false,
            familyInfo: {},
            disabled: true,
            formValidate: {},
            information: "",
            memberInformation: "",
            ruleValidate: {},

        }
    },
    methods: {
        getFamilyInfor() {
            this.familyInfo = this.$parent.familyInfo;
        },
        getTab12Infor() {
            var that = this;
            postAction(that.url.tab12Infor, {
                ss12001Id: this.$parent.familyInfo.ss12001Id,
                type: 's17'
                // oldSs12001Id: this.$parent.familyInfo.oldSs12001Id
            }).then((res) => {
                if (res.data.errcode == 0) {
                    that.formValidate = res.data.data.ss12001Dto;
                    if (that.formValidate.ssca0059) {
                        that.formValidate.ssca0059 = this.DateFormat(that.formValidate.ssca0059, 'YYYY-MM-DD');
                    }
                    if (that.formValidate.ssca0037) {
                        that.formValidate.ssca0037 = this.DateFormat(that.formValidate.ssca0037, 'YYYY-MM-DD');
                    }
                    if (that.formValidate.ssca0033) {
                        that.formValidate.ssca0033 = this.DateFormat(that.formValidate.ssca0033, 'YYYY-MM-DD');
                    }
                    if (that.formValidate.ssca0011) {
                        that.formValidate.ssca0011_again = that.formValidate.ssca0011;
                    }
                    that.information = res.data.data.information;
                    that.memberInformation = res.data.data.memberInformation;
                } else {
                    that.$Message.error(res.data.errmsg);
                }
            }).finally(() => {
                that.Loading = false;
            });
        },
        //获取家庭成员信息
        getMemberList() {
            var that = this;
            postAction(that.url.getMemberList, {azcp0500: this.$parent.familyInfo.ss17001Id}).then((res) => {
                if (res.data.errcode == 0) {
                    that.memberList = res.data.data;
                } else {
                    that.$Message.error(res.data.errmsg);
                }
            }).finally(() => {
                that.Loading = false;
            });
        }
    }
}
